class MyWorkbench(Workbench):
    MenuText = "My Workbench1"      # 工作台的名字
    ToolTip = "A description of my workbench"
    Icon = """paste here the contents of a 16x16 xpm icon"""

    def Initialize(self):
        """This function is executed when FreeCAD starts"""
        import LSY  # import here all the needed files that create your FreeCAD commands



        # add Toolbar
        self.list = ['MySecondCommand01', 'MySecondCommand02']
        self.appendToolbar('My Commands', self.list)

        # add Menu
        self.appendMenu('My New Menu', self.list)
        self.appendMenu(["An existing Menu", "My submenu"], self.list)


    def Activated(self):
        """This function is executed when the workbench is activated"""
        return

    def Deactivated(self):
        """This function is executed when the workbench is deactivated"""
        return

    def ContextMenu(self, recipient):
        """This is executed whenever the user right-clicks on screen"""
        # "recipient" will be either "view" or "tree"
        self.appendContextMenu("My commands", self.list)

    def GetClassName(self):
        # this function is mandatory if this is a full python workbench
        return "Gui::PythonWorkbench"


Gui.addWorkbench(MyWorkbench())

